import router from './router'
import store from './store'

const whiteList = ['/login']

router.beforeEach((to, from, next) => {
  if (whiteList.includes(to.path)) return next()
  if (store.state.user.token) return next()
  next('/login')
})
